Repository navigation
feat(client): cover empty and opaque pagination cursors - #583
bingdongni wants to merge 1 commit into
Conversation
|
Additional cross-platform validation for unchanged head c69c46d (Codex-assisted): the eight pagination controls completed with the expected outcomes at both 2025-11-25 and 2026-07-28 on Windows and Linux, using the built native conformance CLI. The deliberately inert client remains untestable/failing; a fresh discovery after the requested tool call remains passing. No model calls or GPU were used. Native CI evidence: Linux job, Windows job. These jobs also exercise a separate OWASP comparison; the recorded MCP-only checks keep the pagination results separate. Scenario source and lockfile in this PR are unchanged. The head still has no upstream GitHub checks reported; please let me know if a maintainer action is needed to start upstream CI. Core-suite placement and older-spec applicability remain open for review. |
An MCP client that stops on a falsy nextCursor can pass the existing non-paginated tools_call scenario while missing tools on later pages. Add client-pagination, following the proposal in #577, to exercise one complete tools/list traversal and a call to a tool discovered on its last page.
The three pages contain 1, 0, and 2 tools. They advertise an empty-string cursor, an opaque cursor containing whitespace, punctuation and Unicode, then no nextCursor. Four checks cover empty-cursor continuation, cursor preservation through an empty page, the scenario-completion gate, and end-of-results handling. Missing prerequisites produce explicit untestable failures/warnings. The termination SHOULD uses WARNING; a new discovery after the requested tool call is allowed. An invalid cursor followed by a successful retry still fails cursor preservation.
Register the scenario in core, extend everything-client, and add a deliberately broken client with six negative controls and a rediscovery positive control. Reuse the existing scenario context, transports, CLI runner and check types. No dependencies, shared runner changes or frozen requirements manifests are included.
Validation on Windows, Node 22.14.0, locked SDK 1.29.0, based on 96a6f94:
Reproduce after npm ci --ignore-scripts --no-audit --no-fund and npm run build:
node dist/index.js client --scenario client-pagination --spec-version 2025-11-25 --command "node --import tsx examples/clients/typescript/everything-client.ts"
node dist/index.js client --scenario client-pagination --spec-version 2025-11-25 --command "node --import tsx examples/clients/typescript/pagination-broken-client.ts"
Repeat with --spec-version 2026-07-28. The broken client's default is truthy-cursor. MCP_PAGINATION_DEFECT selects the other controls.
Related work: #520 mentions a three-page pagination prototype in its validation narrative; its public file list contains the external loader and trace-id example, rather than that pagination scenario. This PR implements built-in spec coverage and makes no claim to invent pagination testing. Core-suite placement and the older-spec applicability remain reviewable design choices; the explicit empty-string wording is in 2026, while the older schema permits empty strings and requires opaque cursors.
AI assistance: Codex prepared this implementation and ran the checks above. No independent human review is claimed.